import request from '@/axios'
import type { ListParams, Response } from '@/api/api'

export interface Row {
  id?: number
  no: string
  pay_type: string
  order_status: string
  is_salesman: string
  store_name: string
  total_num: string
  total_category: number
  channel_text: number
  channel: number
}
// 销售单列表
export const getListApi = (data: ListParams): Promise<Response<Row>> => {
  return request.post({ url: '/store/order/list', data })
}
// 详情
export const getDetailApi = (id: number): Promise<IResponse<Row>> => {
  return request.post({ url: '/store/order/details', data: { id } })
}

// 删除
export const delApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/store/order/del', data })
}

// 发货
export const getSignApi = (params): Promise<IResponse<string[]>> => {
  return request.get({ url: '/store/order/send_out', params })
}
// 门店取消订单
export const getPutApi = (params): Promise<IResponse<string[]>> => {
  return request.get({ url: '/store/order/cancel', params })
}
// 门店确定收货
export const getConfirmApi = (params): Promise<IResponse<string[]>> => {
  return request.get({ url: '/store/order/confirm', params })
}
